﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AlphaBeatSoundEngine
{
    public enum Tone
    {
        A = 0,
        ASharp = 1,
        B = 2,
        C = 3,
        CSharp = 4,
        D = 5,
        DSharp = 6,
        E = 7,
        F = 8,
        FSharp = 9,
        G = 10,
        GSharp = 11
    }

    public static class ToneExtensions
    {
        public static Tone AdjustFromTone(this Tone tone,  Tone t)
        {
            int intThisTone = (int) tone;
            int intGivenTone = (int)t;

            //adding the two tones
            int finalTone = intThisTone + intGivenTone;
            //if we are out of range, we bring back the number between 0 and 11
            if (finalTone > 11)
            {
                finalTone -= 12;
            }

            return (Tone)finalTone;
        }

        
    }
}
